package com.apiit.webserviceclient.activities;

import java.util.ArrayList;
import java.util.List;

import com.apiit.webserviceclient.Adapter;
import com.apiit.webserviceclient.PaymentAdapter;
import com.apiit.webserviceclient.R;
import com.apiit.webserviceclient.R.layout;
import com.apiit.webserviceclient.R.menu;
import com.apiit.webserviceclient.utils.Book;
import com.apiit.webserviceclient.utils.Payment;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.ListView;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;
import android.widget.Toast;

public class PaymentHistory extends Activity {
	
	PaymentAdapter payadapter;
	TextView date;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_payment_history);
		
		date = (TextView) findViewById(R.id.textView1);
		
		Intent intename = getIntent();
		String []value = intename.getStringArrayExtra("array");

		//01 23 45
		TableLayout table = (TableLayout) findViewById(R.id.tableLayouttest);
		for(int i=0;i<value.length-2;i+=2)
		{
		    TableRow row=new TableRow(this);
		    String debt = value[i].replaceAll("&nbsp;", "").replaceAll("\t", "").replaceAll("\n", "");
		    String fee = value[i+1].replaceAll("&nbsp;", "").replaceAll("\t", "").replaceAll("\n", "");
		    
		    TextView tvDebt=new TextView(this);
		    tvDebt.setText(""+debt +"\t\t\t\t\t\t");
		    tvDebt.setTextSize(14);
		   
		    TextView tvFee=new TextView(this);
		    tvFee.setText(""+fee+"\t\t\t\t\t\t\n");
		    tvDebt.setTextSize(14);
		    
		    row.addView(tvDebt);
		    row.addView(tvFee);
		    table.addView(row);
		    
		}
	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.payment_history, menu);
		return true;
	}

}
